memcpy (retval->shadows, shadows, sizeof (ShadowValue) * n_shadows);
retval->is_computed = TRUE;
+
for (i = 0; i < n_shadows; i++)
{
const ShadowValue *shadow = &retval->shadows[i];
gboolean need_shadow = FALSE;
guint i;
- /* TODO: We can save this as a flag once and then reuse it */
for (i = 0; i < value->n_shadows; i++)
{
const ShadowValue *shadow = &value->shadows[i];
return need_shadow;
}
+
+void
+gtk_css_shadow_value_pop_snapshot (const GtkCssValue *value,
+ GtkSnapshot *snapshot)
+{
+ gboolean need_shadow = FALSE;
+ guint i;
+
+ for (i = 0; i < value->n_shadows; i++)
+ {
+ const ShadowValue *shadow = &value->shadows[i];
+
+ if (!gdk_rgba_is_clear (gtk_css_color_value_get_rgba (shadow->color)))
+ {
+ need_shadow = TRUE;
+ break;
+ }
+ }
+
+ if (need_shadow)
+ gtk_snapshot_pop (snapshot);
+}
G_BEGIN_DECLS
-GtkCssValue * gtk_css_shadow_value_new_none (void);
+GtkCssValue * gtk_css_shadow_value_new_none (void);
GtkCssValue * gtk_css_shadow_value_new_filter (void);
GtkCssValue * gtk_css_shadow_value_parse (GtkCssParser *parser,
gboolean box_shadow_mode);
-GtkCssValue * _gtk_css_shadow_value_parse_filter (GtkCssParser *parser);
+GtkCssValue * gtk_css_shadow_value_parse_filter (GtkCssParser *parser);
void gtk_css_shadow_value_get_extents (const GtkCssValue *shadow,
GtkBorder *border);
gboolean gtk_css_shadow_value_push_snapshot (const GtkCssValue *value,
GtkSnapshot *snapshot);
+void gtk_css_shadow_value_pop_snapshot (const GtkCssValue *value,
+ GtkSnapshot *snapshot);
G_END_DECLS